const fs = require('fs');
const path = require('path');

// 要复制的文件
const cssSource = path.resolve(__dirname, 'node_modules/swagger-ui-dist/swagger-ui.css');
const cssTarget = path.resolve(__dirname, 'docs/.vitepress/public/swagger-ui.css');

// 确保目标目录存在
const targetDir = path.dirname(cssTarget);
if (!fs.existsSync(targetDir)) {
  fs.mkdirSync(targetDir, { recursive: true });
}

// 复制文件
fs.copyFileSync(cssSource, cssTarget);
console.log(`已复制Swagger UI CSS文件到: ${cssTarget}`); 